from django.db import models

from django_starter.db.models import ModelExt


# Create your models here.
class Movie(ModelExt):
    title = models.CharField(max_length=100)
    description = models.TextField()
    year = models.IntegerField()
    rating = models.IntegerField()
    genre = models.CharField(max_length=100)
    director = models.CharField(max_length=100)
    actors = models.CharField(max_length=100)

    def __str__(self):
        return self.title

    class Meta:
        db_table = 'demo_movie'
        ordering = ['title']
        verbose_name = 'Movie'
        verbose_name_plural = 'Movies'
        unique_together = (('title', 'year'),)
        index_together = (('title', 'year'),)
